package day230411;

import java.util.Scanner;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/4/12 15:31
 * 反转字符串
 */
public class Main01 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String input = scan.nextLine(); // 输入字符串
        String reverse = reverseStr(input);
        System.out.println(reverse);
        scan.close();
    }

    // 反转字符串
    private static String reverseStr(String input) {
        char[] charArr = input.toCharArray();
        int start = 0;
        int end = charArr.length - 1;
        while (start < end) {
            swap(charArr, start++, end--);
        }
        return new String(charArr);
    }

    // 交换 i j 位置
    private static void swap(char[] arr, int i, int j) {
        char temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
}
